#ifndef ANIMATION_H_GGJ
#define ANIMATION_H_GGJ

#include "../Defines.h"
#include <sfml/Graphics.hpp>

class CAnimation
{
public:
	CAnimation();
	~CAnimation();

	void SetupAnimation(sf::Sprite& tSprite, int iNumRows, int iNumColumns, float fSpeed);

	void SetSprite(sf::Sprite& tSprite);
	void SetPosition(sf::Vector2f vPos) { m_tSprite.setPosition(vPos); }

	void SetRow(int iRow);

	void SetIdle(bool bIdle);

	void Process(float fTimeDelta);
	void Render(sf::RenderWindow* pWin);

private:
	sf::Sprite	m_tSprite;
	sf::IntRect m_tSubRect;
	float		m_fAnimTimer;
	float		m_fAnimDuration;
	int			m_iNumRows;
	int			m_iNumCols;

	int			m_iActiveCol;
	int			m_iActiveRow;

	int			m_iRectWidth;
	int			m_iRectHeight;

	bool		m_bIdle;
};

#endif // ANIMATION_H_GGJ